home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 9 / applic / textco.bas < prev   
Encoding:
BASIC Source File  |  1986-04-17  |  1.8 KB  |  45 lines

  1. 10    'Text Conversion V1.1 by B.E. Hanscom  CIS 73765,1252
  2. 20    on error goto 280
  3. 30    lf$=chr$(10):cr$=chr$(13):sp$=chr$(32):ssp$=chr$(30)
  4. 40    fullw 2 : clearw 2 :gotoxy 1,1
  5. 50    ?"Text file conversion for compatability with First Word"
  6. 60    ?:?"The file created will contain ''variable spaces'' ($1E)"
  7. 70    ?"in place of ''fixed spaces'' ($20).":?:?
  8. 80    ?"Hit RETURN at Source Filename to exit":?:?
  9. 90    'GET SOURCE FILENAME
  10. 100   input "Source Filename.EXT (RETURN to EXIT) ";s$
  11. 110   if len(s$)=0 then end
  12. 120   open "I",#1,s$
  13. 130   'GET DESTINATION FILENAME
  14. 140   ?
  15. 150   input "Destination Filename.EXT ";d$ :error 0
  16. 160   open "I",#2,d$ : close 2 : ow$="y"
  17. 170   if err<>53 then ?chr$(7):?"File exists ... Overwrite (y/n)";:input ow$
  18. 180   if ow$<>"Y" and ow$<>"y" then 130
  19. 190   open "O",#2,d$
  20. 200   line input#1,i$
  21. 210   if len(i$)=0 then 200
  22. 220   for a=1 to len(i$) : if mid$(i$,a,1)=sp$ then mid$(i$,a,1)=ssp$
  23. 230   next
  24. 240   if right$(i$,1)=lf$ then i$=left$(i$,len(i$)-1)
  25. 250   if left$(i$,1)=lf$ then i$=right$(i$,len(i$)-1)
  26. 260   print# 2,i$;ssp$
  27. 270   goto 200
  28. 280   'Error handling routine
  29. 290   if erl=160 then resume next
  30. 295   if err=0 then resume next
  31. 300   ?:?chr$(7)
  32. 320   close
  33. 330   if err<51 or err>64 then ?"Error! #"err 
  34. 340   if err=51 then ?"Device number invalid"
  35. 350   if err=52 then ?"File number or Filename invalid"
  36. 360   if err=53 then ?"File not found on disk specified"
  37. 370   if err=54 then ?"File mode is not valid"
  38. 380   if err=55 then ?"You cannot OPEN or KILL a file already open"
  39. 390   if err=57 then ?"Disk input/output error"
  40. 400   if err=61 then ?"Disk is full"
  41. 410   if err=62 then ?"Conversion complete!"
  42. 420   if err=64 then ?"Invalid Filename"
  43. 430   ?:?
  44. 440   resume 90
  45. ərrrrrrrrrrrrrr